package com.yj.provider.service;

import com.yj.provider.dynamicDataSource.DataSourceChoose;
import com.yj.provider.dynamicDataSource.DataSourceType;
import com.yj.provider.mapper.UserMapper;
import com.yj.provider.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    @DataSourceChoose(DataSourceType.DB_DEV)
    public List<User> findAll() {
        List<User> list = userMapper.findAll();

        return list;
    }
}
